<?php

/**
 * Detalle form base class.
 *
 * @method Detalle getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseDetalleForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDRUTA'       => new sfWidgetFormInputHidden(),
      'LINEADETALLE' => new sfWidgetFormInputHidden(),
      'IDUBICACION'  => new sfWidgetFormPropelChoice(array('model' => 'Ubicacion', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'IDRUTA'       => new sfValidatorPropelChoice(array('model' => 'Peticion', 'column' => 'IDRUTA', 'required' => false)),
      'LINEADETALLE' => new sfValidatorChoice(array('choices' => array($this->getObject()->getLineadetalle()), 'empty_value' => $this->getObject()->getLineadetalle(), 'required' => false)),
      'IDUBICACION'  => new sfValidatorPropelChoice(array('model' => 'Ubicacion', 'column' => 'IDUBICACION')),
    ));

    $this->widgetSchema->setNameFormat('detalle[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Detalle';
  }


}
